import { CellRenderer } from "../../../../../fl/controls/listClasses/CellRenderer";
import { GTextFormat } from "../../../../common/GTextFormat";
import { FontUtil } from "../../../../common/font/FontUtil";
import { FilterConst } from "../../../../component/gconst/FilterConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
//class PlayerMenuCellRenderer
    
    export  class PlayerMenuCellRenderer extends CellRenderer
    {
        constructor()
        {
            super();
            this._textFormat = new GTextFormat(FontUtil.songtiName, 12, 16777215);
            setSize(95, 19);
            this.textField.filters = [FilterConst.nameGlowFilter];
            this.setStyle("overSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("downSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("overSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("upSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("selectedDownSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("selectedOverSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("selectedUpSkin", GlobalClass.getBitmap("PopUpMenuOverSkin"));
            this.setStyle("textFormat", this._textFormat);
            this.setStyle("disabledSkin", new Object /* flash.display.Bitmap */());
            this.setStyle("disabledTextFormat", GlobalStyle.textFormat3);
            this.addListeners();
            return;
        }

        /* internal  */addListeners(): void
        {
            this.addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.MouseHandler);
            this.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.MouseHandler);
            return;
        }

        /* internal  */MouseHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (arg1.type != flash.events.MouseEvent.MOUSE_OVER) 
            {
                this.setStyle("textFormat", this._textFormat);
            }
            else 
            {
                this.setStyle("textFormat", GlobalStyle.textFormat6);
            }
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            super.data = arg1;
            this.enabled = arg1["enabled"];
            return;
        }

        /* internal */ /* var */_textFormat: Object /* flash.text.TextFormat */;
    }
